package com.example.ole.taskqueue.Q.base;

import com.example.ole.taskqueue.Print;

import static com.example.ole.taskqueue.Q.base.XTaskAbs.RET_NORMAL;
import static com.example.ole.taskqueue.Q.base.XTaskAbs.RET_PAUSED;
import static com.example.ole.taskqueue.Q.base.XTaskAbs.RET_TERMINATED;

public class XProgressController {
    public static String TAG = "RecordingProgressCtrl";
    private volatile int mStatus = RET_NORMAL;

    public void pause() {
        if (mStatus == RET_NORMAL) {
            Print.d(1, 1, TAG, "Pausing recording");
            mStatus = RET_PAUSED;
        }
    }

    public void resume() {
        if (mStatus == RET_PAUSED) {
            Print.d(1, 1, TAG, "Resuming recording");
            mStatus = RET_NORMAL;
        }
    }

    public void terminate() {
        if (mStatus != RET_TERMINATED) {
            Print.d(1, 1, TAG, "Terminating recording");
            mStatus = RET_TERMINATED;
        }
    }

    public int getRecordingStatus() {
        return mStatus;
    }
}
